package org.wlw.web.utils;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class WebUtils {
    public static final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

    public static String dateToString(Date date) {
        return sdf.format(date);
    }

    public static Date strToDate(String sdate) {
        try {
            return sdf.parse(sdate);
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return null;
    }
}
